package com.jiang.Servict;

/**
 * @author jiangjingbo
 * @version V1.0
 * @Project java2203
 * @Package com.jiang.Servict
 * @Description:
 * @Date 2022/6/3 17:09
 */

import com.jiang.pojo.User;
import org.junit.Test;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

/**
 * 测试注入
 */
public class testUser {
    @Test
    public void test1() {
        //创建Spring
        ApplicationContext applicationContext = new ClassPathXmlApplicationContext("applicationContext.xml");
        //调用xml中bean中的 user实体
         User user =(User) applicationContext.getBean("user");
        System.out.println(user);
    }
}
